<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      >
    <h:head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <ui:insert name="meta"></ui:insert>
    <link href="#{request.contextPath}/resources/style.css" rel="stylesheet" type="text/css"/>
    <link href="#{request.contextPath}/resources/layout.css" rel="stylesheet" type="text/css"/>
        <title>
            <ui:insert name="title">Web Based Claim Processing  | eProject Aptech </ui:insert>
        </title>
<!--        <script src="http://maps.google.com/maps/api/js?sensor=false"
        type="text/javascript"></script>-->
        
       <script type="text/javascript">
           
      $(function () {
             setNavigation();
        });

        function setNavigation() {
            var path = window.location.pathname;
            path = path.replace(/\/$/, "");
            path = decodeURIComponent(path);
            $(".art-hmenu a").each(function () {
                var href = $(this).attr('href');
                if (path.substring(0, href.length) === href) {
                    $(this).closest('a').addClass('active');
                } 
            });
        }
    </script> 
<!--[if lt IE 7]>
                   <script type="text/javascript" src="/resources/ie_png.js"></script>
                   <script type="text/javascript">
                       ie_png.fix('.png');
                   </script>
                   <style type="text/css">
                   #header {background:url(/resources/Default/images/top.gif)}
                   </style>
                <![endif]-->
<!--[if IE]>
<style type="text/css">
#header ul li a:hover, #header ul li .current, #header ul .first a:hover,#header ul .first .current,#header ul .last a:hover,#header ul .last .current {background-position: 2px left;}
.kywrds2{color: #576986; font-family : Arial, Helvetica; font-size: 7px; background: #36517C; margin-bottom:0em;line-height:7px;}
.kywrds{color: #E0E1E2; font-family : Arial, Helvetica; font-size: 7px; background: #F7F7F7; margin-bottom:0em;line-height:7px;}
</style>
<![endif]-->		
    </h:head>

    <h:body>
        <p:growl id="growl"/>
        
        <div id="art-page-background-glare-wrapper">
            <div id="art-page-background-glare"></div>
        </div>
        <div id="art-main">
            <div class="cleared reset-box"></div>
            <div id="art-hmenu-bg" class="art-bar art-nav">
            </div>
            <div class="cleared reset-box"></div>
            <div class="art-header">
                <div class="art-header-position">
                    <div class="art-header-wrapper">
                        <div class="cleared reset-box"></div>
                        <div class="art-header-inner">
                            <div class="art-headerobject"></div>
                            <div class="art-logo">
                                <h1 class="art-logo-name"><a href="./home.xhtml">Blue Pumpkin</a></h1>
                                <h2 class="art-logo-text">Friendly Rapport and Win The Price</h2>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="art-bar art-nav">
                    <div class="art-nav-outer">
                        <div class="art-nav-wrapper">
                            <div class="art-nav-inner">
                                <ul class="art-hmenu">

<!--                                <li>
                                        <h:form><h:commandLink id="lnkHome" value="Home" action="/home?faces-redirect=true" styleClass="active"/></h:form>
                                    </li>
                                    <li>
                                        <h:form><h:commandLink id="lnkEvent" value="Event" action="/event?faces-redirect=true"/></h:form>
                                    </li>
                                    <li>
                                        <h:form><h:commandLink id="lnkWinner" value="Winner" action="/winner?faces-redirect=true" /></h:form>
                                    </li>
                                    <li>
                                        <h:form><h:commandLink id="lnkContact" value="Contact" action="/contacts?faces-redirect=true" /></h:form>
                                    </li>

                                    <li>
                                        <h:form><h:commandLink id="lnkFaqs" value="FAQ's" action="/fAQs/viewFAQs?faces-redirect=true"/></h:form>
                                    </li>-->

                                    <li>
                                        <a  href="#{request.contextPath}/faces/home.xhtml"> Home </a>
                                    </li>
                                    <li>
                                        <a  href="#{request.contextPath}/faces/event.xhtml"> Event </a>
                                    </li>
                                    <li>
                                        <a  href="#{request.contextPath}/faces/winner.xhtml"> Winner </a>
                                    </li>
                                    <li>
                                        <a  href="#{request.contextPath}/faces/contacts.xhtml"> Contact </a>
                                    </li>
                                    <li>
                                        <a  href="#{request.contextPath}/faces/fAQs/viewFAQs.xhtml"> FAQ's </a>
                                    </li>
                                    <c:if test="${user == null}">
                                        <li>
                                            <h:form id="form">
                                                <p:commandLink id="lnkLogin" value="Login" oncomplete="loginDialog.show()"/>
                                            </h:form>
                                        </li>

                                    </c:if>
                                    <!-- Nếu đã đăng nhập -->
                                    <c:if test="${user != null}">
                                        <li>
                                                <a class="menu" href="#{request.contextPath}/faces/Admin/ViewProfile.xhtml">Profile </a>
<!--                                            <h:form><h:commandLink id="lnkUserProfile" value="Profile" action="/Admin/ViewProfile?faces-redirect=true"/></h:form>-->
                                        </li>
                                           <!-- Chỉnh sửa lại : Chỉ admin mới được tạo mới User -->
                                           
                                            <c:if test="#{user.isAdmin}">
                                                <li>
<!--                                            <h:form><h:commandLink id="lnkSignUp" value="SignUp" action="/Admin/UserSignup?faces-redirect=true" /></h:form>-->
                                               <a  href="#{request.contextPath}/faces/Admin/UserSignup.xhtml"> Create User </a>
                                                </li>
                                            </c:if>
                                        <li>
                                            <h:form><h:commandLink id="lnkLogout" value="Logout" action="#{userController.logout}"/></h:form>
                                        </li>
                                    </c:if>


                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="cleared reset-box"></div>

            </div>
            <div class="cleared reset-box"></div>
            <div class="art-box art-sheet">
                <div class="art-box-body art-sheet-body">
                    <div class="art-layout-wrapper">
                        <div class="art-content-layout">
                            <div class="art-content-layout-row">
                                <div class="art-layout-cell art-content">
                                    <div class="art-box art-post">
                                        <div class="art-box-body art-post-body">
                                            <div class="art-post-inner art-article">
                                                <div class="art-postcontent">
                                                    <div class="art-content-layout-wrapper layout-item-0">
                                                        <div class="art-content-layout">
                                                            <div class="art-content-layout-row">
                                                                <div class="art-layout-cell layout-item-1" style="width: 27%;">
                                                                    <span style="font-weight: bold;">
                                                                        <c:if test="${user == null}">
                                                                            To encourage the employees and to build a friendly rapport in the company they
                                                                            started conducting games and distributing the prizes.
                                                                        </c:if>

                                                                        <c:if test="${user != null }">
                                                                          
                                                                            <c:if test="${user.isAdmin}">
                                                                                <ul style="list-style-type: square;" >

                                                                                <li>
                                                                                    <a  href="#{request.contextPath}/faces/Admin/AdminListUser.xhtml">  Management User </a>  
<!--                                                                                    <span>
                                                                                       <h:form>
                                                                                            <h:commandLink action="/Admin/AdminListUser" value="Managed User"/>
                                                                                        </h:form>
                                                                                        
                                                                                    </span>-->
                                                                                </li>

                                                                                <li>
                                                                                      <a  href="#{request.contextPath}/faces/event.xhtml">  Management Event </a>  
<!--                                                                                    <span><h:form>
                                                                                            <h:commandLink action="/event" value="Managed Event"/>
                                                                                        </h:form></span>
                                                                                -->
                                                                                </li>
                                                                                <li>
                                                                                     <a  href="#{request.contextPath}/faces/winner.xhtml">  Management Winner </a>  
<!--                                                                                    <span><h:form>
                                                                                            <h:commandLink action="/batch/List" value="Managed Winner"/>
                                                                                        </h:form>
                                                                                    </span>-->
                                                                                </li>

                                                                                <li>
                                                                                    <a  href="#{request.contextPath}/faces/Event/LisParticipateEvent.xhtml">  List Participte Event </a>  
<!--                                                                                    <span><h:form>
                                                                                            <h:commandLink action="/Event/LisParticipateEvent?faces-redirect=true" value="List Participte Event"/>
                                                                                        </h:form></span>-->
                                                                                </li>


                                                                                <li>
                                                                                    <a  href="#{request.contextPath}/faces/fAQs/ManageFAQs.xhtml">  Management FAQs </a>  
<!--                                                                                    <span><h:form>
                                                                                            <h:commandLink id="lnkManagedFAQs" action="/fAQs/ManageFAQs?faces-redirect=true" value="List of FAQs"/>
                                                                                        </h:form></span>
                                                                                -->
                                                                                
                                                                                </li>


                                                                                <li>
<!--                                                                                    <span><h:form>
                                                                                            <h:commandLink action="/feedback/List" value="Managed FeedBack"/>
                                                                                        </h:form></span>-->
                                                                                   <a  href="#{request.contextPath}/faces/feedback/List.xhtml">  Management Feedback </a>     
                                                                                </li>
                                                                                 </ul>           
                                                                            </c:if>
                                                                            <c:if test="${!user.isAdmin}">

                                                                                <!-- Đã chỉnh sửa : không hiện thị thông tin User -->
                                                                                <!--
                                                                                <li><span>
                                                                                        <h:outputText value="#{user.userName}" style="word-break:break-all;"/>
                                                                                           
                                                                                        <br/>

                                                                                        <h:outputText value="#{user.birthDay}" >
                                                                                            <f:convertDateTime pattern="MM/dd/yyyy" />
                                                                                        </h:outputText>
                                                                                        <br/>
                                                                                        <h:outputText value="#{user.email}" style="word-break:break-all;"/>
                                                                                        
                                                                                        <br/>
                                                                                        <h:outputText value="#{user.phoneNumber}"/>
                                                                                     
                                                                                        <br/>
                                                                                         <h:outputText value="#{user.addressInfo}" style="word-break:break-all;"/>
                                                                                        

                                                                                    </span>
                                                                               </li>
                                                                                -->
                                                                                <li>
                                                                                    <h:form><h:commandLink id="lnkUserProfile" value="Profile" action="/Admin/ViewProfile?faces-redirect=true" /></h:form>
                                                                                </li>
                                                                                <li>
                                                                                    <h:form><h:commandLink id="lnkUserProfile2" value="List Participte Event" action="#{registrationController.prepareViewParticipateUser}" /></h:form>
                                                                                </li>
                                                                                <li>
                                                                                    <h:form><h:commandLink id="lnkFaqs" value="Feedback" action="/feedback/ListFB?faces-redirect=true"/></h:form>
                                                                                </li>
                                                                                 <li>
                                                                                    <h:form><h:commandLink id="lnkChangePass" value="Change Password" action="/ChangePassword?faces-redirect=true"/></h:form>
                                                                                </li>

                                                                            </c:if>
                                                                        </c:if>




                                                                        <br /></span>
                                                                    <p>

                                                                        <table>
                                                                            <tr>
                                                                                <h3> Newest Winner</h3>
                                                                            </tr>
                                                                            <tr>
                                                                                <ui:repeat value="#{winnerController.newestWinner}" var="w">
                                                                                    <p><b> #{w.registration.userInfo.userName}</b> - <i> #{w.registration.eventInfo.eventName} </i> </p>
                                                                                </ui:repeat>
                                                                            </tr>
                                                                        </table>

                                                                    </p>
                                                                </div><div class="art-layout-cell layout-item-2" style="width: 73%;">
                                                                    <ui:insert name="content">Content</ui:insert>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>

                                                </div>
                                                <div class="cleared"></div>
                                            </div>

                                            <div class="cleared"></div>
                                        </div>
                                    </div>

                                    <div class="cleared"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="cleared"></div>

                    <div class="cleared"></div>
                </div>
            </div>
            <div class="art-footer">
                <div class="art-footer-body">
                    <div class="art-footer-center">
                        <div class="art-footer-wrapper">
                            <div class="art-footer-text">


                                <p>Copyright © 2013. All Rights Reserved.</p><br />
                                <div class="cleared"></div>
                                <p class="art-page-footer"><a href="" target="_blank">Website Bluepumpkin</a> created with Group1 - Aprotrain Aptech.</p>
                            </div>
                        </div>
                    </div>
                    <div class="cleared"></div>
                </div>
            </div>
            <div class="cleared"></div>
        </div>
    </h:body>
    
    <h:form id="form1">
            <p:dialog header="Login" resizable="false" modal="true" id="loginDialog" widgetVar="loginDialog"  showEffect="fade" hideEffect="explode">
            <h:panelGrid id="display" columns="2" cellpadding="4" style="margin:0 auto;">
                <h:outputText value="Username:" />
                <p:inputText value="#{userController.username}" id="txtUsername" title="username" />
                <h:outputText value="Password:" />
                <h:inputSecret value="#{userController.password}" title="password"
                               id="txtPassword" styleClass="ui-inputfield ui-inputtext ui-widget ui-state-default ui-corner-all"/>
                <f:facet name="footer">
                    <p:commandButton id="btnLogin" ajax="false" action="#{userController.checkLogin}" value="Login"
                                     oncomplete="loginDialog.hide()" image="ui-icon ui-icon-check" />
                    <p:commandButton id="btnCancel" onclick="loginDialog.hide()" type="reset" image="ui-icon ui-icon-close" value="Cancel" />
                </f:facet>
            </h:panelGrid>
        </p:dialog>
    </h:form>
</html>
